'++LotusScript Development Environment:2:5:(Options):0:66 '++LotusScript Development Environment:2:5:(Forward):0:1 Declare Sub Click(Source As Button, X As Long, Y As Long, Flags As Long) '++LotusScript Development Environment:2:5:(Declarations):0:2 '++LotusScript Development Environment:2:2:BindEvents:1:129 Private Sub BindEvents(Byval Objectname_ As String) Static Source As BUTTON Set Source = Bind(Objectname_) On Event Click From Source Call Click End Sub '++LotusScript Development Environment:2:2:Click:1:12 Sub Click(Source As Button, X As Long, Y As Long, Flags As Long) Dim Con As New connection Dim Qry As New query Dim RS As New resultset Dim rval As Integer Dim ValidTable, i As Integer Dim InputPath As String Dim TableNm As String ValidTable = False rval = Messagebox( "Permanently remove Approach sample data?",36,"Lotus Approach") If rval = 6 Then Forall table In CurrentDocument.tables For i = 0 To table.NumFields - 1 If table.Fieldnames(i) = "SAMPLE" Then ValidTable = True If Instr(1,table.TableName, ":") > 0 Then TableNm = Mid$( table.TableName, 1, Instr(1, table.TableName, ":") - 1) Else TableNm = table.TableName End If End If Next If ValidTable = True Then If (Con.ConnectTo("dBASE IV")) Then Set Qry.Connection = Con Qry.Sql = "SELECT * FROM """ & table.FullName & """ " & TableNm & " WHERE (" & TableNm & ".SAMPLE = 'Approach Sample Data')" Set RS.Query = Qry Do While RS.Execute = False InputPath = Inputbox$("Couldn't access "+ TableNm +" for import." & "Please enter the full path and database name","Warning") If InputPath = "" Then Exit Sub Else Qry.Tablename = InputPath End If Loop Else Messagebox "Couldn't access "+ TableNm +" for import. " & "Connection not available" Exit Sub End If Do While RS.numrows <> 0 RS.Deleterow Loop End If ValidTable = False End Forall Set ButtonLbl = CurrentDocument.Main~ Menu.body.DeleteLbl Set ButtonDel = CurrentDocument.Main~ Menu.body.DeleteBtn Delete ButtonLbl Delete ButtonDel CurrentWindow.SaveChanges CurrentWindow.Refresh RS.Close Con.Disconnect End If End Sub